HDEBUG.DOC Documentation for HDEBUG.PAS (C) Copyright 1991, Brian D. Webb & P-Machinery Release 1.0, October 20, 1991 These routines are just a stripped down version of a heap debugging package that I'm working on. HEAP.TPU contains routines to intercept EVERY call to TP6's heap routines New(),Dispose(),GetMem(), and FreeMem(), including the new extended syntax for New() and Dispose(). Since the heart of these routines is the heap interceptor, I thought I'd send it out for a little beta testing while I iron out the bugs in the rest of the package. These routines work for the IDE, Turbo Debugger, and standalone EXE files. To intercept the heap routines, the variables HEAP.Allocation_Handler and HEAP.Deallocation_Handler need to contain the addresses of far routines of type Handler, which is: type Handler = Procedure(Size : Word; BlockAddr,CallAddr : Pointer); The interceptor will pass along the size of the memory block, its address, and the address of the calling routine to the handler for error checking. The unit HDEBUG10.PAS contains a generic handler which can flag the user whenever a potential fatal heap error has occured without exiting the debugging session. The unit MAPINFO.PAS allows HDEBUG10.PAS to determine the unit and line number of the error. To use: Include the units (Heap,HDebug10,MapInfo) in your uses clause. In your main program, be sure to set MapFileName to the path name of the map file. Also, be sure to compile to disk and generate a detailed map file. To activate the heap interceptor, call the procedure HeapOn. To deactivate, call HeapOff. Please forward comments and criticisms to: Brian D. Webb 76436,1131 If you need help really bad, give me a call at 713-427-0071